package com.waterflow.xanner;

import com.waterflow.xanner.model.PlayerProgress;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;

public class StartGameActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_start_game);
        
        PlayerProgress progress = new PlayerProgress(this);
        progress.loadProgress(this);
        
        if(!progress.finishedFirstLevel()){
        	findViewById(R.id.continueButton).setVisibility(View.GONE);
        }
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_start_game, menu);
        return true;
    }

    public void continueGame(View view) {
    	Intent game = new Intent(view.getContext(), PuzzleActivity.class);
    	startActivity(game);
    }
    
    public void startTutorial(View view) {
    	Intent tutorial = new Intent(view.getContext(), TutorialActivity.class);
    	startActivity(tutorial);
    }
    
    public void newGame(View view) {
    	PlayerProgress progress = new PlayerProgress(this);
    	progress.saveProgress(this);
    	Intent game = new Intent(view.getContext(), PuzzleActivity.class);
    	startActivity(game);
    }
}
